using System;
using System.Data;

using Wicresoft.Common;

namespace Wicresoft.Messages.Entity
{
    [Table("VMessageStatus", null, "Wicresoft.Messages.ConnectionString")]
	public class VMessageStatus : ViewInfo
	{
		#region SQL column name consts 
		public const string SQLCOL_QUEUEID = "QueueID";
		public const string SQLCOL_MESSAGEID = "MessageID";
		public const string SQLCOL_MESSAGETEXT = "MessageText";
		public const string SQLCOL_MESSAGETITLE = "MessageTitle";
		public const string SQLCOL_DEVICEID = "DeviceID";
		public const string SQLCOL_QUEUESTATUS = "QueueStatus";
		public const string SQLCOL_LASTOPERATIONTIME = "LastOperationTime";
		public const string SQLCOL_SENDERNAME = "SenderName";
		public const string SQLCOL_SENDERDISPLAYNAME = "SenderDisplayName";
		public const string SQLCOL_RECEIVERNAME = "ReceiverName";
		public const string SQLCOL_RECEIVERDISPLAYNAME = "ReceiverDisplayName";
		public const string SQLCOL_RECEIVERCONTACT = "ReceiverContact";
		public const string SQLCOL_PROCESSSTATUS = "ProcessStatus";
		public const string SQLCOL_PROCESSTIME = "ProcessTime";
		public const string SQLCOL_PROCESSCOUNT = "ProcessCount";
		public const string SQLCOL_SENDTIME = "SendTime";
		public const string SQLCOL_GOTTIME = "GotTime";
		public const string SQLCOL_READTIME = "ReadTime";
		public const string SQLCOL_PRIORITY = "Priority";
		public const string SQLCOL_OUTERPK = "OuterPK";
		public const string SQLCOL_STATUSDESCRIPTION = "StatusDescription";
		public const string SQLCOL_STATUS = "Status";
		#endregion


		#region Contructors
		/// <summary>
		/// Construct empty entity
		/// </summary>
		public VMessageStatus () {}

		#endregion

		public override void Init (DataRow row)
		{
			QueueID = (Guid)ObjectType.GuidTypeHelper.Read(row[SQLCOL_QUEUEID]);
			MessageID = (Guid)ObjectType.GuidTypeHelper.Read(row[SQLCOL_MESSAGEID]);
			MessageText = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_MESSAGETEXT]);
			MessageTitle = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_MESSAGETITLE]);
			DeviceID = (int)ObjectType.IntTypeHelper.Read(row[SQLCOL_DEVICEID]);
			QueueStatus = (int)ObjectType.IntTypeHelper.Read(row[SQLCOL_QUEUESTATUS]);
			LastOperationTime = (DateTime)ObjectType.DateTimeTypeHelper.Read(row[SQLCOL_LASTOPERATIONTIME]);
			SenderName = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_SENDERNAME]);
			SenderDisplayName = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_SENDERDISPLAYNAME]);
			ReceiverName = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_RECEIVERNAME]);
			ReceiverDisplayName = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_RECEIVERDISPLAYNAME]);
			ReceiverContact = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_RECEIVERCONTACT]);
			ProcessStatus = (int)ObjectType.IntTypeHelper.Read(row[SQLCOL_PROCESSSTATUS]);
			ProcessTime = (DateTime)ObjectType.DateTimeTypeHelper.Read(row[SQLCOL_PROCESSTIME]);
			ProcessCount = (int)ObjectType.IntTypeHelper.Read(row[SQLCOL_PROCESSCOUNT]);
			SendTime = (DateTime)ObjectType.DateTimeTypeHelper.Read(row[SQLCOL_SENDTIME]);
			GotTime = (DateTime)ObjectType.DateTimeTypeHelper.Read(row[SQLCOL_GOTTIME]);
			ReadTime = (DateTime)ObjectType.DateTimeTypeHelper.Read(row[SQLCOL_READTIME]);
			Priority = (int)ObjectType.IntTypeHelper.Read(row[SQLCOL_PRIORITY]);
			OuterPK = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_OUTERPK]);
			StatusDescription = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_STATUSDESCRIPTION]);
			Status = (int)ObjectType.IntTypeHelper.Read(row[SQLCOL_STATUS]);
		}

		#region Properties 
		#region Property <Guid> QueueID
		[Property("QueueID", 16, SqlDbType.UniqueIdentifier, false, false)]
		public Guid QueueID 
		{
			get { return _QueueID; }
			set { _QueueID = value; }
		}
		private Guid _QueueID = Guid.Empty;
		#endregion

		#region Property <Guid> MessageID
		[Property("MessageID", 16, SqlDbType.UniqueIdentifier, false, false)]
		public Guid MessageID 
		{
			get { return _MessageID; }
			set { _MessageID = value; }
		}
		private Guid _MessageID = Guid.Empty;
		#endregion

		#region Property <string> MessageText
		[Property("MessageText", 2147483646, SqlDbType.NText, false, false)]
		public string MessageText 
		{
			get { return _MessageText; }
			set { _MessageText = value; }
		}
		private string _MessageText = null;
		#endregion

		#region Property <string> MessageTitle
		[Property("MessageTitle", 2147483646, SqlDbType.NText, false, false)]
		public string MessageTitle 
		{
			get { return _MessageTitle; }
			set { _MessageTitle = value; }
		}
		private string _MessageTitle = null;
		#endregion

		#region Property <int> DeviceID
		[Property("DeviceID", 4, SqlDbType.Int, false, false)]
		public int DeviceID 
		{
			get { return _DeviceID; }
			set { _DeviceID = value; }
		}
		private int _DeviceID = int.MinValue;
		#endregion

		#region Property <int> QueueStatus
		[Property("QueueStatus", 4, SqlDbType.Int, false, false)]
		public int QueueStatus 
		{
			get { return _QueueStatus; }
			set { _QueueStatus = value; }
		}
		private int _QueueStatus = int.MinValue;
		#endregion

		#region Property <DateTime> LastOperationTime
		[Property("LastOperationTime", 16, SqlDbType.DateTime, false, false)]
		public DateTime LastOperationTime 
		{
			get { return _LastOperationTime; }
			set { _LastOperationTime = value; }
		}
		private DateTime _LastOperationTime = DateTime.MinValue;
		#endregion

		#region Property <string> SenderName
		[Property("SenderName", 100, SqlDbType.NVarChar, false, false)]
		public string SenderName 
		{
			get { return _SenderName; }
			set { _SenderName = value; }
		}
		private string _SenderName = null;
		#endregion

		#region Property <string> SenderDisplayName
		[Property("SenderDisplayName", 100, SqlDbType.NVarChar, false, false)]
		public string SenderDisplayName 
		{
			get { return _SenderDisplayName; }
			set { _SenderDisplayName = value; }
		}
		private string _SenderDisplayName = null;
		#endregion

		#region Property <string> ReceiverName
		[Property("ReceiverName", 100, SqlDbType.NVarChar, false, false)]
		public string ReceiverName 
		{
			get { return _ReceiverName; }
			set { _ReceiverName = value; }
		}
		private string _ReceiverName = null;
		#endregion

		#region Property <string> ReceiverDisplayName
		[Property("ReceiverDisplayName", 100, SqlDbType.NVarChar, false, false)]
		public string ReceiverDisplayName 
		{
			get { return _ReceiverDisplayName; }
			set { _ReceiverDisplayName = value; }
		}
		private string _ReceiverDisplayName = null;
		#endregion

		#region Property <string> ReceiverContact
		[Property("ReceiverContact", 200, SqlDbType.NVarChar, false, false)]
		public string ReceiverContact 
		{
			get { return _ReceiverContact; }
			set { _ReceiverContact = value; }
		}
		private string _ReceiverContact = null;
		#endregion

		#region Property <int> ProcessStatus
		[Property("ProcessStatus", 4, SqlDbType.Int, false, false)]
		public int ProcessStatus 
		{
			get { return _ProcessStatus; }
			set { _ProcessStatus = value; }
		}
		private int _ProcessStatus = int.MinValue;
		#endregion

		#region Property <DateTime> ProcessTime
		[Property("ProcessTime", 16, SqlDbType.DateTime, false, false)]
		public DateTime ProcessTime 
		{
			get { return _ProcessTime; }
			set { _ProcessTime = value; }
		}
		private DateTime _ProcessTime = DateTime.MinValue;
		#endregion

		#region Property <int> ProcessCount
		[Property("ProcessCount", 4, SqlDbType.Int, false, false)]
		public int ProcessCount 
		{
			get { return _ProcessCount; }
			set { _ProcessCount = value; }
		}
		private int _ProcessCount = int.MinValue;
		#endregion

		#region Property <DateTime> SendTime
		[Property("SendTime", 16, SqlDbType.DateTime, false, false)]
		public DateTime SendTime 
		{
			get { return _SendTime; }
			set { _SendTime = value; }
		}
		private DateTime _SendTime = DateTime.MinValue;
		#endregion

		#region Property <DateTime> GotTime
		[Property("GotTime", 16, SqlDbType.DateTime, false, false)]
		public DateTime GotTime 
		{
			get { return _GotTime; }
			set { _GotTime = value; }
		}
		private DateTime _GotTime = DateTime.MinValue;
		#endregion

		#region Property <DateTime> ReadTime
		[Property("ReadTime", 16, SqlDbType.DateTime, false, false)]
		public DateTime ReadTime 
		{
			get { return _ReadTime; }
			set { _ReadTime = value; }
		}
		private DateTime _ReadTime = DateTime.MinValue;
		#endregion

		#region Property <int> Priority
		[Property("Priority", 4, SqlDbType.Int, false, false)]
		public int Priority 
		{
			get { return _Priority; }
			set { _Priority = value; }
		}
		private int _Priority = int.MinValue;
		#endregion

		#region Property <string> OuterPK
		[Property("OuterPK", 100, SqlDbType.NVarChar, false, false)]
		public string OuterPK 
		{
			get { return _OuterPK; }
			set { _OuterPK = value; }
		}
		private string _OuterPK = null;
		#endregion

		#region Property <string> StatusDescription
		[Property("StatusDescription", 100, SqlDbType.NVarChar, false, false)]
		public string StatusDescription 
		{
			get { return _StatusDescription; }
			set { _StatusDescription = value; }
		}
		private string _StatusDescription = null;
		#endregion

		#region Property <int> Status
		[Property("Status", 4, SqlDbType.Int, false, false)]
		public int Status 
		{
			get { return _Status; }
			set { _Status = value; }
		}
		private int _Status = int.MinValue;
		#endregion
		#endregion
	}
}
